<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景图片练习</title>
    <style>
        div {
            width: 300px;
            height: 300px;
            background-color: thistle;
            background-image: url(images/xx.png);
            background-repeat: repeat-x;
            background-position: center;
            line-height: 300px;
        }
    </style>
</head>

<body>
    <div></div>
</body>
</html>